<script setup lang="ts">
import { computed,PropType } from 'vue';
import { FontTypeEnum } from './types';
const props=defineProps({
    type:{
        type: String as PropType<FontTypeEnum>,
        required:true,
    },
    size:{
        type:Number,
        default:1
    }
})
const classMap={
    [FontTypeEnum.Blog] :"icon-blog",
    [FontTypeEnum.Empty] :"icon-empty",
    [FontTypeEnum.Home] :"icon-home",
}

console.log(props.size);


const fontClass=computed(()=>{
    return classMap[props.type];
})
</script>
<template>
    <i class="iconfont icon-container" :class="fontClass" :style='{
        fontSize:size+"em"
    }'></i>
</template>
<style lang="less" scoped>
@import url("~@/styles/font/iconfont.css");
.iconfont {
    color: inherit;
    font-size: inherit;
}
</style>
